<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>HTTP POST 变量</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="reserved.variables.get.html">$_GET</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="reserved.variables.files.html">$_FILES</a></div>
 <div class="up"><a href="reserved.variables.html">预定义变量</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="reserved.variables.post" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">$_POST</h1>
  <h1 class="refname">$HTTP_POST_VARS [已弃用]</h1>
  <p class="refpurpose"><span class="refname">$_POST</span> -- <span class="refname">$HTTP_POST_VARS [已弃用]</span> &mdash; <span class="dc-title">HTTP POST 变量</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-reserved.variables.post-description">
  <h3 class="title">说明</h3>
  <p class="para">
   通过 HTTP POST 方法传递给当前脚本的变量的数组。
  </p>

  <p class="simpara">
   <var class="varname"><var class="varname">$HTTP_POST_VARS</var></var> 包含相同的信息，但它不是一个<a href="language.variables.superglobals.html" class="link">超全局变量</a>。
   (注意 <var class="varname"><var class="varname">$HTTP_POST_VARS</var></var> 和 <var class="varname"><var class="varname">$_POST</var></var> 是不同的变量，PHP 处理它们的方式不同)
  </p>

 </div>

 

 <div class="refsect1 changelog" id="refsect1-reserved.variables.post-changelog">
  <h3 class="title">更新日志</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>版本</th>
       <th>说明</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>4.1.0</td>
       <td>
        引入 <var class="varname"><var class="varname">$_POST</var></var>，弃用 <var class="varname"><var class="varname">$HTTP_POST_VARS</var></var>。
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>

 
 <div class="refsect1 examples" id="refsect1-reserved.variables.post-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="variable.post.basic">
    <p><strong>Example #1 <var class="varname"><var class="varname">$_POST</var></var> 范例</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #DD0000">'Hello&nbsp;'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">htmlspecialchars</span><span style="color: #007700">(</span><span style="color: #0000BB">$_POST</span><span style="color: #007700">[</span><span style="color: #DD0000">"name"</span><span style="color: #007700">])&nbsp;.&nbsp;</span><span style="color: #DD0000">'!'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>
     假设用户通过 HTTP POST 方式传递了参数 name=Hannes
    </p></div>
    <div class="example-contents"><p>以上例程的输出类似于：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Hello Hannes!
</pre></div>
    </div>
   </div>
  </p>
 </div>

 
 <div class="refsect1 notes" id="refsect1-reserved.variables.post-notes">
  <h3 class="title">注释</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para">“Superglobal”也称为自动化的全局变量。这就表示其在脚本的所有作用域中都是可用的。不需要在函数或方法中用
<strong class="command">global $variable;</strong> 来访问它。</p></p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-reserved.variables.post-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><a href="language.variables.external.html" class="link">处理外部变量</a></li>
    <li class="member"><a href="book.filter.html" class="link">过滤器扩展</a></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="reserved.variables.get.html">$_GET</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="reserved.variables.files.html">$_FILES</a></div>
 <div class="up"><a href="reserved.variables.html">预定义变量</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
